<?php require_once('Connections/sepolwan_connect.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_data_terbaru = "SELECT * FROM artikel WHERE jenis = 'News' ORDER BY id DESC LIMIT 6";
$data_terbaru = mysql_query($query_data_terbaru, $sepolwan_connect) or die(mysql_error());
$row_data_terbaru = mysql_fetch_assoc($data_terbaru);

?>
<div id="judul"><strong>NEWS &frasl; BERITA</strong></div>

<div id="konsam">
    	<div id="tab1" class="tab_konten">

          <?php do { ?>
          <div style="width:100%; height:70px; margin-top:10px; text-align:justify"><strong><a href="<?php echo $base ?>detail-<?php echo $row_data_terbaru['id']; ?>/<?php echo str_replace(array(' ', '`', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '=', '{', '}', '|', ',', ':', ';', '"', '<', '>', ',', '.', '?', '/'), '-', $row_data_terbaru['judul']); ?>.html"><?php echo $row_data_terbaru['judul']; ?></a></strong><br />
  <?php echo tgl_indo($row_data_terbaru['waktu']); ?></div><div style="width:100%; height:1px; background:#CCC;"></div>
  <?php } while ($row_data_terbaru = mysql_fetch_assoc($data_terbaru)); ?>

        </div>
		
  </div>
    <?php
mysql_free_result($data_terbaru);
?>
